<%--
  Created by IntelliJ IDEA.
  User: miao
  Date: 2022/11/10
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
  <head>
    <title>学习计划界面</title>
      <link rel="stylesheet" type="text/css" href="css/page.css">
      <link rel="stylesheet" type="text/css" href="css/backButton.css">
    </style>
  </head>
  <body>
    <table border="1px">
<%--      <button class="btn-back" onclick="javascript:window.history.back(-1);"><span>返回</span></button>--%>
      <caption>学习计划管理页</caption>
        <thead>
          <tr>
            <th>自增主键</th>
            <th>用户id</th>
            <th>计划名称</th>
            <th>计划日期</th>
            <th>计划时长</th>
            <th>操作</th>
          </tr>
        </thead>
      <tbody>
      <c:forEach items="${studyInfoPage.list}" var="studyInfo">
        <tr>
          <td>${studyInfo.studyId}</td>
          <td>${studyInfo.userId}</td>
          <td>${studyInfo.planName}</td>
          <td>${studyInfo.planDate}</td>
          <td>${studyInfo.planTimeHour}小时${studyInfo.planTimeMinute}分钟</td>
          <td><a href="DeleteStudyInfoServlet?studyId=${studyInfo.studyId}">删除</a></td>
        </tr>
      </c:forEach>
      </tbody>
      <tfoot>
      <div class="page">
        <a href="ShowStudyPlan">首页</a>
        <a href="ShowStudyPlan?num=${studyInfoPage.prePageNum}">上一页</a>
        <a href="ShowStudyPlan?num=${studyInfoPage.nextPageNum}">下一页</a>
        <a href="ShowStudyPlan?num=${studyInfoPage.totalPageNum}">末页</a>
        <select  id="pageSelect" name="pageSelect" onchange="changePage(this.value)">
          <c:forEach var="i" begin="1" end="${studyInfoPage.totalPageNum}">
            <c:if test="${i == studyInfoPage.currentPageNum }">
              <option value="${i }" selected="selected">第${i }页</option>
            </c:if>
            <c:if test="${i != studyInfoPage.currentPageNum }">
              <option value="${i }">第${i }页</option>
            </c:if>
          </c:forEach>
        </select>
      </div>
      </tfoot>
      <script type="text/javascript">
        function changePage(page){
          window.location.href="ShowStudyPlan?num=" + page;
        }
      </script>
    </table>
    </table>
  </body>
</html>






















